package FactoryPatternEnstance;

import javax.xml.parsers.*;

import FactoryPatternEnstance.*;
import org.w3c.dom.*;

import java.io.*;
import java.util.ArrayList;
import java.util.List;

public class Main {
    public static void main(String[] args) {
        AbstractSaloonCar mySaloonCar;
        AbstractTrucks myTrucks;
        AbstractSuvs mySuvs;
        AbstracttLorry myLorry;
        //工厂一是比亚迪汽车工厂，工厂二是大众汽车工厂
        ICarFactory CarFactory1 = new CarFactoryBYD();
        ICarFactory CarFactory2 = new CarFactoryVW();
        //我的汽车都由工厂一生产时
        mySaloonCar = CarFactory1.getSaloonCarEnstance();
        myTrucks    = CarFactory1.getTrucksEnstance();
        myLorry     = CarFactory1.getLorryEnstance();
        mySuvs      = CarFactory1.getSuvsEnstance();
        System.out.println(mySaloonCar.showName());
        System.out.println(myTrucks.showName());
        System.out.println(myLorry.showName());
        System.out.println(mySuvs.showName());
        System.out.println("================================================");
        // //我的汽车都由工厂二生产时
        mySaloonCar = CarFactory2.getSaloonCarEnstance();
        myTrucks    = CarFactory2.getTrucksEnstance();
        myLorry     = CarFactory2.getLorryEnstance();
        mySuvs      = CarFactory2.getSuvsEnstance();
        System.out.println(mySaloonCar.showName());
        System.out.println(myTrucks.showName());
        System.out.println(myLorry.showName());
        System.out.println(mySuvs.showName());


    }
}